/*

 * Copyright (C) 2021 Huawei Device Co., Ltd.

 * Licensed under the Apache License, Version 2.0 (the "License");

 * you may not use this file except in compliance with the License.

 * You may obtain a copy of the License at

 *

 *     http://www.apache.org/licenses/LICENSE-2.0

 *

 * Unless required by applicable law or agreed to in writing, software

 * distributed under the License is distributed on an "AS IS" BASIS,

 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

 * See the License for the specific language governing permissions and

 * limitations under the License.

 */
package com.chinalwb.are.utils;

import ohos.agp.components.AttrSet;
import ohos.agp.components.TextField;
import ohos.app.Context;

/**
 * 用于监听光标变化
 *
 * @author hal
 * @since 2021/06/22
 */
public class CursorTextField extends TextField {
    public CursorTextField(Context context) {
        this(context, null);
    }

    public CursorTextField(Context context, AttrSet attrSet) {
        super(context, attrSet);
    }

    /**
     * 监听光标
     *
     * @param listener listener
     */
    public void setCursorChangedListener(MyCursorChangedListener listener) {
        super.setCursorChangedListener(listener);
    }

    @Override
    public void setCursorChangedListener() {
        super.setCursorChangedListener();
    }

    /**
     * MyCursorChangedListener
     */
    public interface MyCursorChangedListener extends CursorChangedListener {
        void onCursorChange(TextField var1, int var2, int var3);
    }
}
